package com.sumqun.mall.service;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.transaction.annotation.Transactional;

import com.sumqun.mall.entity.Account;

@Transactional
public interface AccountService {
	/**
	 * verify user
	 * 
	 * @param username
	 * @param password
	 * @return
	 */
	Boolean verify(String username, String password, String usertype);

	Boolean verify(String uid);
	
	Account getVerifyUser(String username, String password, String usertype);
	
	@Transactional(readOnly = true)
	List findAllAccount(int offset, int pageSize);
	
	int findAllCount();

	@Transactional(readOnly = true)
	Account findAccount(int uid);

	@Transactional(readOnly = false, rollbackFor = DataAccessException.class)
	void register(Account account);

	@Transactional(readOnly = false, rollbackFor = DataAccessException.class)
	void editAccount(Account account);

	@Transactional(readOnly = false, rollbackFor = DataAccessException.class)
	void removeAccout(int uid);

}
